home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Grand Slam 3
/
Grand Slam 3.iso
/
026
/
imphob10.arj
/
IMP10_EX.ARJ
/
W_GEMMIS.ARJ
/
GEMMIS.INC
< prev
next >
Wrap
Text File
|
1995-05-15
|
5KB
|
202 lines
;║ A FLAT REAL MODE INITIALIZER EXAMPLE
;║ ────────────────────────────────────
;║
;║ Compliant with RAW, XMS or EMS environments
;║
;║ Documentation used :
;║ microsoft eXtended Memory Specification (XMS) ver 3.0
;║ lotus/intel/microsoft Expanded Memory Specification (EMS) ver 4.0
;║ microsoft undocumented Global EMM Import Specification (GEMMIS) ver 1.11
;║
;║ Documentation needed :
;║ standard method for detecting drivers which use the VDISK allocation scheme
;║ (this is an official publication by microsoft but I don't have it)
;║
;║ (c) Walken / IMPACT Studios in 1995 - for publication in Imphobia #10
;╚════════════════════════════════════════════════════════════════════════════
;│ Legal stuff :
;│ This document can be copyed only when unmodified and in its entirety.
;│ Commercial use - including commercial distribution or use in commercial
;│ software - is strictly prohibited without the written permission
;│ of the author.
;│ The author excludes any and all implied warranties, including warranties
;│ of merchantability and fitness for a particular purpose. The author
;│ should have no liability for special, incidental, or consequential
;│ damages arising out or resulting from the use or modification of this
;│ source code.
;└────────────────────────────────────────────────────────────────────────────
;║ You can contact the author at the following address :
;║ Walken / IMPACT Studios
;║ Michel LESPINASSE - 18 rue Jean Giono - 80090 Amiens - FRANCE
;╚════════════════════════════════════════════════════════════════════════════
.data
dump_version db "GEMMIS version : $"
dump_size db " size : $"
dump_umb db " -> UMB frame : "
umb_status db ".... index : $"
dump_ems db " -> EMS frame $"
dump_umb_frame_descriptor_1 db "UMB frame descriptor $"
dump_umb_frame_descriptor_2 db " : $"
dump_ems_info_record_1 db "EMS info record $"
dump_ems_info_record_2 db " : handle $"
dump_ems_info_record_3 db ' "'
dump_ems_name db ' " size $'
dump_ems_info_record_4 db " pages",13,10,"$"
.code
;******************************************************;
;* dump of the GEMMIS data table in a readable format *;
;******************************************************;
; this code is slooooow because of the multiple calls
; to DOS interrupts while running in flat real mode
mov esi,d import_buffer
xor ax,ax
mov es,ax
mov dx,o dump_version
call dump_msg
mov ax,w import_buffer+4
xchg al,ah
call dump_word
mov dx,o dump_size
call dump_msg
mov ax,es:[esi+2]
call dump_word
call dump_line
mov cx,64
add esi,10
xor ebx,ebx
dump_ems_frame_status_record:
mov al,es:[esi]
test al,3ch
jnz umb_dump_frame_status_record
test al,3
jnz common_dump_frame_status_record
mov ax,bx
call dump_word
mov dx,o dump_ems
call dump_msg
call dump_line
jmp common_dump_frame_status_record
umb_dump_frame_status_record:
mov ax,bx
call dump_word
mov d umb_status,"...."
mov al,es:[esi]
test al,4
jz no_umb_1
mov umb_status[0],"U"
no_umb_1:
test al,8
jz no_umb_2
mov umb_status[1],"U"
no_umb_2:
test al,16
jz no_umb_3
mov umb_status[2],"U"
no_umb_3:
test al,32
jz no_umb_4
mov umb_status[3],"U"
no_umb_4:
mov dx,o dump_umb
call dump_msg
mov al,es:[esi+1]
call dump_byte
call dump_line
common_dump_frame_status_record:
add esi,6
add bx,400h
loop dump_ems_frame_status_record
movzx cx,b es:[esi+1]
add esi,2
jcxz no_umb_frame_descriptors
xor bl,bl
dump_umb_frame_descriptor:
mov dx,o dump_umb_frame_descriptor_1
call dump_msg
mov al,bl
call dump_byte
mov dx,o dump_umb_frame_descriptor_2
call dump_msg
mov eax,es:[esi]
shl eax,12
call dump_dword
call dump_space
mov eax,es:[esi+4]
shl eax,12
call dump_dword
call dump_space
mov eax,es:[esi+8]
shl eax,12
call dump_dword
call dump_space
mov eax,es:[esi+12]
shl eax,12
call dump_dword
call dump_line
inc bl
add esi,16
loop dump_umb_frame_descriptor
no_umb_frame_descriptors:
movzx cx,b es:[esi]
inc esi
or cx,cx
jz no_ems_info_records
xor bl,bl
dump_ems_info_record:
mov dx,o dump_ems_info_record_1
call dump_msg
mov al,bl
call dump_byte
mov dx,o dump_ems_info_record_2
call dump_msg
mov al,es:[esi]
call dump_byte
mov eax,es:[esi+2]
mov d dump_ems_name,eax
mov eax,es:[esi+6]
mov d dump_ems_name+4,eax
mov dx,o dump_ems_info_record_3
call dump_msg
mov ax,es:[esi+10]
mov bp,ax
call dump_word
mov dx,o dump_ems_info_record_4
call dump_msg
mov edi,es:[esi+12]
or bp,bp
jz no__
dump_ems_info_record_addr:
call dump_space
mov eax,es:[edi]
and ax,0f000h
call dump_dword
call dump_space
mov eax,es:[edi+4]
and ax,0f000h
call dump_dword
call dump_space
mov eax,es:[edi+8]
and ax,0f000h
call dump_dword
call dump_space
mov eax,es:[edi+12]
and ax,0f000h
call dump_dword
call dump_line
add edi,16
dec bp
jnz dump_ems_info_record_addr
no__:
inc bl
add esi,16
dec cx
jnz dump_ems_info_record
no_ems_info_records:
call dump_line
call dump_line